package cn.xxliang.platapp.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import cn.xxliang.platapp.pojo.dto.ProductFileInfoDto;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import cn.xxliang.platapp.common.BaseRespWithData;
import cn.xxliang.platapp.pojo.query.ProductFileInfoQuery;

@RestController
@RequestMapping("/productFile")
@Api(tags = "产品附件管理")
@Validated
public class ProductFileController {
    
    @PostMapping("/upload")
    @ApiOperation(value = "上传产品附件 ✅", notes = "上传产品相关附件信息")
    public BaseRespWithData uploadProductFile(@RequestBody @Valid ProductFileInfoDto productFileInfoDto) {
        // 这里实现上传逻辑        
        return new BaseRespWithData().code(200).msg("添加成功");
    }

    @PostMapping("/queryByFileId")
    @ApiOperation(value = "根据platform_product_id 查询相应的附件信息 ✅", notes = "通过platform_product_id获取对应的附件信息")
    public BaseRespWithData queryProductFileInfoById(@RequestBody @NotNull(message = "产品 ID 不能为空！") String platformProductId) {
        // 这里实现根据附件id查询附件信息的逻辑
        return new BaseRespWithData().code(200).msg("查询成功").data("文件列表");
    }

    @PostMapping("/deleteByFileId")
    @ApiOperation(value = "根据附件id删除文件 ✅", notes = "通过附件id删除对应的附件文件")
    public BaseRespWithData deleteProductFileById(@RequestBody @NotNull(message = "附件id不能为空") String fileId) {
        // 这里实现根据附件id删除文件的逻辑
        return new BaseRespWithData().code(200).msg("删除成功");
    }
}
